Page({
  data: {
    repairList: [],
    isEmpty: false
  },
  onLoad () {
    this.getRepairList()
  },
  async getRepairList () {
    const { data } = await wx.http.get('/repair', { current: 1, pageSize: 10 })
    this.setData({ repairList: data.rows, isEmpty: data.rows.length === 0 })
  },
  goDetail (ev) {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + ev.mark.id
    })
  },
  addRepair () {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index'
    })
  }
})
